package pho.prowon.index;

import java.util.Collection;
import java.util.List;


/**
 * @author Peter
 *
 * This is the interface for Index
 */

public interface IndexImplementation 
{	
	/**
	 * Writes a new index for the collection of images
	 * @param images a collection of instances implementing ImageDataContainer
	 */
	public void writeIndex (Collection images);
	
	/**
	 * reads an index and instantiates one object per entry and adds it to a list
	 * @param toBeInstantiated the class used for storing the images' data, must implement ImageDataContainer
	 * @return a list of ImageDataContainers instances of the class passed  
	 */
	public List readIndex (Class toBeInstantiated);
	
	/**
	 * reads an index and instantiates one object per entry and adds it to a List
	 * @param toBeInstantiated the class used for storing the images' data, must implement ImageDataContainer
	 * @param checkIt if true, images are checked for their existence in the file system
	 * @return a list of ImageDataContainers instances of the class passed  
	 */
	public List readIndex (Class toBeInstantiated, Boolean checkIt);
	
	/**
	 * reads an index and instantiates one object per entry and adds it to a List
	 * the image data is reloaded from the actual image files, all image data in the index is 
	 * simply ignored
	 * @param toBeInstantiated the class used for storing the images' data, must implement ImageDataContainer
	 * @return a list of ImageDataContainers instances of the class passed  
	 */
	public List readAndReloadIndex (Class toBeInstantiated);
}